<template>
  <div class="website">
    <table class="content-table">
      <tr class="content-title">
        <td>主要参数</td>
        <td>一号机组</td>
        <td>二号机组</td>
      </tr>
      <tr>
        <td class="content-title">机组负荷 MW</td>
        <td class="content-value">{{ towNumber(dataModel['1DCS_SELMW']) }}</td>
        <td class="content-value">{{ towNumber(dataModel['2DCS_SELMW']) }}</td>
      </tr>
      <tr>
        <td class="content-title">主汽压力 MPa</td>
        <td class="content-value">
          {{ towNumber(dataModel['1DCS_THRPRESS']) }}
        </td>
        <td class="content-value">
          {{ towNumber(dataModel['2DCS_THRPRESS']) }}
        </td>
      </tr>
      <tr>
        <td class="content-title">主汽温度 ℃</td>
        <td class="content-value">
          {{ towNumber(dataModel['1DCS_MSTMTEM']) }}
        </td>
        <td class="content-value">
          {{ towNumber(dataModel['2DCS_MSTMTEM']) }}
        </td>
      </tr>
      <tr>
        <td class="content-title">再热汽温度 ℃</td>
        <td class="content-value">{{ towNumber(dataModel['1DCS_RHTSEL']) }}</td>
        <td class="content-value">{{ towNumber(dataModel['2DCS_RHTSEL']) }}</td>
      </tr>
      <tr>
        <td class="content-title">给水温度 ℃</td>
        <td class="content-value">
          {{ towNumber(dataModel['1DCS_LAB34CT150']) }}
        </td>
        <td class="content-value">
          {{ towNumber(dataModel['2DCS_LAB34CT150']) }}
        </td>
      </tr>
      <tr>
        <td class="content-title">凝汽器真空 KPa</td>
        <td class="content-value">
          {{ towNumber(dataModel['1DCS_10MAG10CP101']) }}
        </td>
        <td class="content-value">
          {{ towNumber(dataModel['2DCS_10MAG10CP101']) }}
        </td>
      </tr>
    </table>
  </div>
</template>
<script>
export default {
  name: 'SppLeftTop',
  props: {
    data: { type: Object, default: () => {} }
  },
  data() {
    return {
      dataModel: {
        M0_yxts: 0,
        HY_0_003: 0,
        '2DCS_2FT04OUT': 0,
        '1DCS_COM_J0NDA10CT150': 0,
        '1DCS_SELMW': 0,
        '2DCS_SELMW': 0,
        '1DCS_THRPRESS': 0,
        '2DCS_THRPRESS': 0,
        '1DCS_MSTMTEM': 0,
        '2DCS_MSTMTEM': 0,
        '1DCS_RHTSEL': 0,
        '2DCS_RHTSEL': 0,
        '1DCS_LAB34CT150': 0,
        '2DCS_LAB34CT150': 0,
        '1DCS_10MAG10CP101': 0,
        '2DCS_10MAG10CP101': 0
      }
    }
  },
  watch: {
    data(newValue) {
      this.dataModel = newValue
    }
  },
  methods: {
    towNumber(val) {
      return val.toFixed(2)
    }
  }
}
</script>

<style lang="scss" scoped>
.website {
  width: 100%;
  height: 95%;
  padding-top: 10px;
}
.lineChart {
  border: 1px solid #50e9ff;
  padding-top: 10px;
  width: 49%;
  height: 95%;
}
.tableChart {
  width: 49%;
  height: 95%;
}

.content-table {
  padding-top: 10px;
  text-align: center;
  width: 100%;
  height: 100%;
  th,
  tr,
  td {
    text-align: center;
    font-size: 12px;
  }
}

.content-title {
  color: #50e9ff;
  td {
    padding: 10px 0;
  }
}
.content-value {
  color: chartreuse;
}
</style>
